	
	$(document).ready(function(){
		// global setting override
		
		$.extend($.gritter.options, { 
			fade_in_speed: 1000, // how fast notifications fade in (string or int)
			//fade_out_speed: 100, // how fast the notices fade out
			time: 10000 // hang on the screen for...
		});
		if(document.getElementById('hiddenSession').value!="yes")
			setTimeout('test()',2000);
		
		$('#add-regular').click(function(){
										 
			setTimeout('test()',2000)
	
			return false;
		
		});
		

		$('#add-with-callbacks').click(function(){
			
			$.gritter.add({
				// (string | mandatory) the heading of the notification
				title: 'This is a notice with callbacks!',
				// (string | mandatory) the text inside the notification
				text: 'The callback is...',
				// (function | optional) function called before it opens
				before_open: function(){
					alert('I am called before it opens');
				},
				// (function | optional) function called after it opens
				after_open: function(e){
					alert("I am called after it opens: \nI am passed the jQuery object for the created Gritter element...\n" + e);
				},
				// (function | optional) function called before it closes
				before_close: function(e){
					alert("I am called before it closes: I am passed the jQuery object for the Gritter element... \n" + e);
				},
				// (function | optional) function called after it closes
				after_close: function(){
					alert('I am called after it closes');
				}
			});
			
			return false;
		});
		
		$('#add-sticky-with-callbacks').click(function(){
			
			$.gritter.add({
				// (string | mandatory) the heading of the notification
				title: 'This is a sticky notice with callbacks!',
				// (string | mandatory) the text inside the notification
				text: 'Sticky sticky notice.. sticky sticky notice...',
				// Stickeh!
				sticky: true,
				// (function | optional) function called before it opens
				before_open: function(){
					alert('I am a sticky called before it opens');
				},
				// (function | optional) function called after it opens
				after_open: function(e){
					alert("I am a sticky called after it opens: \nI am passed the jQuery object for the created Gritter element...\n" + e);
				},
				// (function | optional) function called before it closes
				before_close: function(e){
					alert("I am a sticky called before it closes: I am passed the jQuery object for the Gritter element... \n" + e);
				},
				// (function | optional) function called after it closes
				after_close: function(){
					alert('I am a sticky called after it closes');
				}
			});
			
			return false;
			
		});
		
		$("#remove-all").click(function(){
			
			$.gritter.removeAll();
			return false;
			
		});
		

		
	});
	
	function test(){
			$.gritter.add({
				// (string | mandatory) the heading of the notification
				title: "Gamer'a hoşgeldin "+document.getElementById('hiddenName').value,
				// (string | mandatory) the text inside the notification
				text: "Gamer üzerinde toplam oyun sayısı 1000'e ulaştı",
				before_open:'',
				// (string | optional) the image to display on the left
				image: 'http://a0.twimg.com/profile_images/59268975/jquery_avatar_bigger.png',
				// (bool | optional) if you want it to fade out on its own or just sit there
				sticky: false, 
				// (int | optional) the time you want it to be alive for before fading out
				time: ''
			});
		}
	